package com.realsil.android.wristbanddemo.greendao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.realsil.android.wristbanddemo.greendao.SportData;
import com.realsil.android.wristbanddemo.greendao.SleepData;

import com.realsil.android.wristbanddemo.greendao.SportDataDao;
import com.realsil.android.wristbanddemo.greendao.SleepDataDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig sportDataDaoConfig;
    private final DaoConfig sleepDataDaoConfig;

    private final SportDataDao sportDataDao;
    private final SleepDataDao sleepDataDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        sportDataDaoConfig = daoConfigMap.get(SportDataDao.class).clone();
        sportDataDaoConfig.initIdentityScope(type);

        sleepDataDaoConfig = daoConfigMap.get(SleepDataDao.class).clone();
        sleepDataDaoConfig.initIdentityScope(type);

        sportDataDao = new SportDataDao(sportDataDaoConfig, this);
        sleepDataDao = new SleepDataDao(sleepDataDaoConfig, this);

        registerDao(SportData.class, sportDataDao);
        registerDao(SleepData.class, sleepDataDao);
    }
    
    public void clear() {
        sportDataDaoConfig.getIdentityScope().clear();
        sleepDataDaoConfig.getIdentityScope().clear();
    }

    public SportDataDao getSportDataDao() {
        return sportDataDao;
    }

    public SleepDataDao getSleepDataDao() {
        return sleepDataDao;
    }

}
